[#include "/app/common/layout/__backstagemainlayout.html"/]
[@mainlayout pageJavascript=pageJavascript pageCss=pageCss currentMenu="typeFlag-typesListFlag"]

<div class="page-header">
	<h1>
		类型管理
	</h1>
</div>
<div class="hr hr-dotted"></div>
	<table class="table table-bordered table-hover">
		<thead>
			<tr>
				<th width="2%">序号</th>
				<th width="10%">类型名称</th>
				<th width="2%">父节点编号</th>
				<th width="5%">创建时间</th>
				<th width="4%">状态</th>
				<th width="4%">操作</th>
			</tr>
		</thead>
		<tbody>
		[#list etypeTree as etypes]
			<tr>
				<td>${(etypes.id)!}</td>
				<td> ${(etypes.name)!}</td>
				<td>${(etypes.pid)!}</td>
				<td>${(etypes.created_at)!}</td>
				<td>
					<b>
					[#if etypes.deleted_at??]
					<span class="red">禁用</span>
					[#else]
					<span class="gray">正常</span>
					[/#if]
					</b>
				</td>
				<td>
				<div class="action-buttons">
				<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/type/edit?id=${(etypes.id)!}" >编辑</a>
				[#if etypes.deleted_at??]
				<a class="btn btn-minier btn-danger btn-xs"  href="${ContextPath}/admin/type/on?id=${(etypes.id)!}" >启用</a>
				[#else]
				<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/type/off?id=${(etypes.id)!}" >禁用</a>
				[/#if]
				<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/type/add?id=${(etypes.id)!}" >添加</a>
				</div>
				</td>
			</tr>
				[#list etypes.children as etype]
				<tr>
					<td>${(etype.id)!}</td>
					<td><span class="glyphicon glyphicon-minus-sign"></span>     ${(etype.name)!}</td>
					<td>${(etype.pid)!}</td>
					<td>${(etype.created_at)!}</td>
					<td>
						<b>
						[#if etype.deleted_at??]
						<span class="red">禁用</span>
						[#else]
						<span class="gray">正常</span>
						[/#if]
						</b>
					</td>
					<td>
						<div class="action-buttons">
							<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/type/edit?id=${(etype.id)!}" >编辑</a>
							[#if etype.deleted_at??]
							<a class="btn btn-minier btn-danger btn-xs"  href="${ContextPath}/admin/type/on?id=${(etype.id)!}" >启用</a>
							[#else]
							<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/type/off?id=${(etype.id)!}" >禁用</a>
							[/#if]
						</div>
					</td>
				</tr>
				[/#list]
			[/#list]
		</tbody>
		
	</table>
[/@mainlayout]